package com.pajk.user.api.http;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.pajk.test.api.BaseTest;
import com.pajk.test.client.ContextHelper;
import com.pingan.jk.api.request.ApiCode;
import com.pingan.jk.api.request.User_ChangePassword;
import com.pingan.jk.api.resp.Api_BoolResp;
import com.pingan.jk.client.ApiContext;
import com.pingan.jk.client.BaseRequest;

public class User_ChangePasswordIT extends BaseTest{
	@Test(description="user.changePassword 设置密码 SecurityType.UserLogin")
	public void changePasswordTest() throws Exception{
		ApiContext context = super.userRegister("100|20|3|4|", getRandomPhoneNumber());
		System.out.println(context.getUserId());
		String md5Passwd = getUploadPassword("123456");
		System.out.println(md5Passwd);
		User_ChangePassword req = new User_ChangePassword(md5Passwd);
		ContextHelper.sendRequest(context, new BaseRequest[] { req });
		Assert.assertEquals(req.getReturnCode() , ApiCode.SUCCESS);
		
		Api_BoolResp res = req.getResponse();
		Assert.assertNotNull(res);
		System.out.println(res.value);
		//
	}
	
}
